package com.zhuoshi.serviceImpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.zhuoshi.bean.WdHtBuild;
import com.zhuoshi.bean.WdHtProject;
import com.zhuoshi.mapper.WdHtBuildMapper;
import com.zhuoshi.mapper.WdHtProjectMapper;
import com.zhuoshi.service.WdHtBuildService;
import com.zhuoshi.service.WdHtProjectService;

/**
 * 
 * @author Alex 关于楼栋功能模块的的service
 */
@Service
public class WdHtBuildServiceImpl implements WdHtBuildService {
	@Autowired
	private WdHtBuildMapper wdHtBuildMapper;

	@Autowired
	private WdHtProjectMapper wdHtProjectMapper;

	@Override
	public List<WdHtBuild> getAll() {
		return wdHtBuildMapper.selectAll("");
	}

	/**
	 * 查询全部的项目
	 */
	@Override
	public List<WdHtProject> getAllProject() {
		return wdHtProjectMapper.selectAll(null);
	}

	/**
	 * 添加一个楼栋的操作
	 */
	@Override
	public int add(WdHtBuild WdHtBuild) {
		return wdHtBuildMapper.insert(WdHtBuild);
	}

	/**
	 * 修改一个楼栋的操作
	 */
	@Override
	public int upOne(WdHtBuild WdHtBuild) {
		
		return wdHtBuildMapper.updateByPrimaryKeySelective(WdHtBuild);
	}
	/**
	 * 删除一个的操作
	 */

	@Override
	public int del(String buildId) {
		
		return wdHtBuildMapper.deleteByPrimaryKey(buildId);
	}
	
	/**
	 *  查询一个的功能
	 */
	@Override
	public WdHtBuild selectOne(String buildId) {
		
		return wdHtBuildMapper.selectByPrimaryKey(buildId);
	}
}
